package grammer.components;

/**
 * 
 * 
 * @author Minodor
 * 
 *         Enumeration for predicates
 */
public enum PredicateEnum implements Component {
	CLEANS, CLOSES_WINDOW, COMES_HOME, DRINKS, EATS, ENTERS, GENERIC_PREDICATE, GOES_TO_BED, IDLE, IS_RESTING, LEAVES, OPENS_WINDOW, SETS, SHOWERS, TAKES_A_BATH, TURNS_EVERYTHING_OFF, TURNS_OFF, TURNS_ON, USES, WAKES_UP_IN, WASHES;
	public Component match(String toMatch) {
		for (PredicateEnum predicate : PredicateEnum.values()) {
			if (predicate.toString().equalsIgnoreCase(toMatch))
				return predicate;
		}
		return null;
	}

	@Override
	public String toString() {
		switch (this) {
		case OPENS_WINDOW:
			return "opens_window";
		case CLOSES_WINDOW:
			return "closes_window";
		case TAKES_A_BATH:
			return "takes_a_bath";
		case USES:
			return "uses";
		case WASHES:
			return "washes";
		case LEAVES:
			return "leaves";
		case COMES_HOME:
			return "comes_home";
		case ENTERS:
			return "enters";
		case WAKES_UP_IN:
			return "wakes_up_in";
		case GOES_TO_BED:
			return "goes_to_bed";
		case TURNS_ON:
			return "turns_on";
		case TURNS_OFF:
			return "turns_off";
		case DRINKS:
			return "drinks";
		case SETS:
			return "sets";
		case IDLE:
			return "idle";
		case SHOWERS:
			return "showers";
		case EATS:
			return "eats";
		case TURNS_EVERYTHING_OFF:
			return "turns_everything_off";
		case IS_RESTING:
			return "is_resting";

		default:
			return "predicate";
		}
	}
}
